<?php



namespace App\Http\Requests\ApiV2;

use Carbon\Carbon;
use Illuminate\Support\Facades\Auth;

class MediaRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required|max:120',

        ];
    }

    public function messages()
    {
        return [
            'title.required' => __('请输入视频标题'),
            'title.max' => __('课程标题的长度不能超过:size个字符', ['size' => 120]),
            'media_url.required' => __('请上传资源链接'),

        ];
    }

    public function filldata()
    {
        return [
            'corp_id' => (int)$this->header('corp_id', 0),
            'media_url' => (string)$this->input('media_url'),
            'path' => (string)$this->input('path'),
            'category_id' => (int)$this->input('category_id'),
            'title' => (string)$this->input('title'),

        ];
    }
}
